<!DOCTYPE html>
<html>

<head>
    <link rel="stylesheet" href="../../css/common/reset.css">
    <link rel="stylesheet" href="../../css/readMore.css">
</head>

<body style="background: #fff;">
    <!--列表 class="wechatPopup "-->
    <form action="?" class="layui-form">
        <ul>
            <li>
                <p>你确定删除【<span id="shopName"></span>】店铺吗？删除之后不能再重新绑定。</p>
            </li>
            <li>
                <input type="button" value="提交" class="btn sureBtn" lay-submit="" lay-filter="delShopInfo">
                <input type="button" value="返回" class="btn editBtn" id="closeIframe">
            </li>
        </ul>
    </form>
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/jquery.cookie.js"></script>
    <script src="../../layui/layui.js"></script>
    <script src="../../js/dataRequest.js"></script>
    <script>
        var delInfo = JSON.parse($.cookie('delInfo'));
        console.log("你是个什么", delInfo);
        $("#shopName").html(delInfo.shop_name);
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        //关闭iframe
        $('#closeIframe').click(function () {
            parent.layer.close(index);
        });
        layui.use(['jquery', 'form'], function () {
            $ = layui.jquery;
            form = layui.form;
            //监听提交
            form.on('submit(delShopInfo)', function (data) {
                var shopId = delInfo.id;
                console.log("店铺Id", shopId);
                var JdateJson = {
                    "id": shopId
                }
                // return;
                $.ajax({
                    url: BASE_URL + MAP_URL + '/order/' + shopId,
                    type: 'delete',
                    dataType: 'json',
                    contentType: "application/json;charset=utf-8",
                    data: JSON.stringify(JdateJson),
                    success: function (data) {
                        console.log("数据是谁", data.data);
                        var _Success = data.code;
                        if (_Success == 200) {
                            layer.msg("删除成功");
                            // return;
                            setTimeout(function () {
                                parent.layer.close(index);//关闭弹出层
                                parent.location.reload();//更新父级页面（提示：如果需要跳转到其它页面见下文）
                            }, 2000);
                        } else {
                            layer.msg(data.data);
                        }
                    }
                })
                //防止页面跳转
                return false;
            });
        });
    </script>
</body>

</html>